package Thread;

import java.util.concurrent.Semaphore;

//信号量
public class ThreadDemo33 {
    public static void main(String[] args) throws InterruptedException {
        Semaphore semaphore=new Semaphore(10);
        semaphore.acquire();//请求操作
        System.out.println("P操作");
        semaphore.acquire();
        System.out.println("P操作");
        semaphore.release();//释放操作
    }
}
